package com.yz.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yz.entity.Membership;
import com.yz.entity.Student;
import com.yz.entity.dto.StudentDto;
import com.yz.mapper.MembershipMapper;
import com.yz.mapper.StudentMapper;
import com.yz.service.StudentService;

/**
 * 学生表实现类
 * @author 于万伟
 *
 */
@Service
public class StudentServiceImpl implements StudentService{
	@Autowired
	StudentMapper studentMapper;
	@Autowired
	MembershipMapper membershipMapper;
	
	@Override
	public List<Student> getStu(Student studentDto) {
		return studentMapper.getStu(studentDto);
	}

	@Override
	public boolean addStu(Student student) {
		return studentMapper.addStu(student);
	}

	@Override
	public boolean updateStu(Student student) {
		return studentMapper.updateStu(student);
	}

	@Override
	public boolean delStu(int stuid) {
		return studentMapper.delStu(stuid);
	}

	@Override
	public Student getStuById(int id) {
		return studentMapper.getStuById(id);
	}

	@Override
	public List<Membership> getAllMem() {
		return membershipMapper.getAllMem();
	}

	@Override
	public List<Student> queryByIds(String ids) {
		String[] split = ids.split(",");
		return studentMapper.queryByIds(split);
	}

}
